package nowCoder;

/**
 * Created by Ghost on 2015/2/12.
 */
public class HanNoidTower {
    /**
     *
     * @param z templates "from"
     * @param x templates "to"
     * @param y templates "through"
     * @param n move top n templates
     */
    public void move(char z ,char x, char y, int n){
        if(n==0)
            return ;
        move(z,y,x,n-1);
        System.out.println(z+"->"+x);
        move(y,x,z,n-1);
    }
    public static void main(String[] args){
        HanNoidTower hanNoidTower = new HanNoidTower();
        hanNoidTower.move('z','x','y',3);
    }
}
